# $Id: PKGBUILD 78918 2012-10-27 22:40:46Z ebelanger $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: Daenyth <Daenyth [at] aur [dot] archlinux [dot] org>
# Contributor: Jeff Mickey <jeff@archlinux.org>

pkgname=lastfmsubmitd
pkgver=1.0.6
pkgrel=7
pkgdesc="A Last.fm 'plugin' client for MPD, implemented in Python."
arch=('any')
url="http://www.red-bean.com/decklin/software/lastfmsubmitd/"
license=('MIT')
depends=('python2-mpdclient2')
makedepends=('python2')
optdepends=('mpd: For local audio playback')
backup=('etc/lastfmsubmitd.conf')
source=(http://www.red-bean.com/decklin/software/$pkgname/$pkgname-$pkgver.tar.gz
	lastmp
	lastfmsubmitd
	lastmp.conf
	lastfmsubmitd.conf
        lastmp.service
        lastfmsubmitd.service
        lastfmsubmitd.tmpfiles)
md5sums=('eadf6f8a7c3a5f8b6311a6fae5c117f6'
         '6ddbe79e137cb25188919a963e7eb22f'
         '611147857b3df72446cbeafd8691afc6'
         'f331cb1fca46eb0b91be269babe49224'
         'c1ed7a40539e67998513968a9d8c6007'
         '8e492a01fb1a1be422f1f393b593a02b'
         'f9c73787c53201287bc4b0a80c58e6f5'
         '0439ad3cb820dabf9b2e4f4f453e88cf')

package() {
  cd "$srcdir"/$pkgname-$pkgver
  sed -i 's#/usr/bin/python#/usr/bin/python2#' contrib/lastmp lastfmsubmit lastfmsubmitd
  python2 setup.py install --prefix="$pkgdir"/usr --optimize=1

  install -D -m 600 "$srcdir"/lastfmsubmitd.conf "$pkgdir"/etc/lastfmsubmitd.conf
  install -D -m 600 "$srcdir"/lastmp.conf "$pkgdir"/etc/lastmp.conf
  install -D -m 755 "$srcdir"/lastfmsubmitd "$pkgdir"/etc/rc.d/lastfmsubmitd
  install -D -m 755 "$srcdir"/lastmp "$pkgdir"/etc/rc.d/lastmp
  install -D -m 644 "$srcdir"/lastmp.service "$pkgdir"/usr/lib/systemd/system/lastmp.service
  install -D -m 644 "$srcdir"/lastfmsubmitd.service "$pkgdir"/usr/lib/systemd/system/lastfmsubmitd.service
  install -D -m 644 "$srcdir"/lastfmsubmitd.tmpfiles "$pkgdir"/usr/lib/tmpfiles.d/lastfmsubmitd.conf

  install -D -m 755 contrib/lastmp "$pkgdir"/usr/bin/lastmp
  install -D -m 644 doc/lastmp.1 "$pkgdir"/usr/share/man/man1/lastmp.1

  install -d "$pkgdir"/var/log/lastfm
  install -d "$pkgdir"/var/spool/lastfm
  install -d "$pkgdir"/var/cache/lastfm
  install -D -m644 README "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

# vim:set ts=2 sw=2 et:
